import * as utils from './utils';

const local = {
  set(key, value) {
    localStorage.setItem(key, JSON.stringify(value));
  },
  get(key) {
    let _value = localStorage.getItem(key);
    return JSON.parse(_value);
  },
  del(key) {
    localStorage.removeItem(key);
  }
};
const user = {
  login(data) {
    return utils.noAuthRequest('GET', 'user/login', data);
  }
};
const food = {
  list() {
    return utils.noAuthRequest('GET', 'food/list');
  }
};
const order = {
  commit(data) {
    return utils.noAuthRequest('GET', 'order/commit', data);
  },
  list(data) {
    return utils.noAuthRequest('GET', 'order/list', data);
  }
};
export default {
  local,
  user,
  food,
  order
};
